package com.sh.healthtv.net.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by 675 on 16-5-27 14:55.
 * 类说明
 * UI层的观察者onError()时，返回的msg要转为此类。以便获取ret和错误信息
 */
public class FaildBean extends BaseBean implements Parcelable {
    /**
     * 接口返回的数据解析失败，默认错误码888
     */
    public static final int RESULT_NULL = 888;
    /**
     * 返回状态（Integer）0：成功  其他：失败。
     */
    private int ret = RESULT_NULL;
    /**
     * 错误信息
     */
    private String desc;

    public int getRet() {
        return ret;
    }

    public void setRet(int ret) {
        this.ret = ret;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "FaildBean{" +
                "ret=" + ret +
                ", desc='" + desc + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.ret);
        dest.writeString(this.desc);
    }

    public FaildBean() {
    }

    protected FaildBean(Parcel in) {
        this.ret = in.readInt();
        this.desc = in.readString();
    }

    public static final Creator<FaildBean> CREATOR = new Creator<FaildBean>() {
        @Override
        public FaildBean createFromParcel(Parcel source) {
            return new FaildBean(source);
        }

        @Override
        public FaildBean[] newArray(int size) {
            return new FaildBean[size];
        }
    };
}
